import 'package:flutter/material.dart';
import 'package:flutter_app/demo/demo_page.dart';
import 'package:flutter_app/demo/home_page.dart';
import 'package:flutter_app/demo/tab_bar_demo.dart';
import 'package:flutter_app/features/auth/screens/login_screen.dart';
import 'package:go_router/go_router.dart';

import '../demo/sqlite_demo_page.dart';
import '../demo/network_demo_page.dart';
import '../demo/image_demo_page.dart';
import '../demo/video_demo_page.dart';
import '../features/main/screens/main_screen.dart';
import '../features/wallet/screens/wallet_screen.dart';
import '../features/wallet/screens/transactions_screen.dart';
import '../features/wallet/screens/crypto_recharge_screen.dart';

/// The route configuration.
final router = GoRouter(
  initialLocation: '/',
  routes: <RouteBase>[
    GoRoute(
      path: '/',
      builder: (BuildContext context, GoRouterState state) {
        return const LoginScreen();
      },
      routes: <RouteBase>[
        GoRoute(
          path: 'login',
          builder: (BuildContext context, GoRouterState state) {
            return const LoginScreen();
          },
        ),
        GoRoute(
          path: 'main',
          builder: (BuildContext context, GoRouterState state) {
            return const MainScreen();
          },
        ),
        GoRoute(
          path: 'details',
          builder: (BuildContext context, GoRouterState state) {
            return const DemoPage();
          },
        ),
        GoRoute(
          path: 'wallet',
          builder: (BuildContext context, GoRouterState state) {
            return const WalletScreen();
          },
          routes: [
            GoRoute(
              path: 'transactions',
              builder: (BuildContext context, GoRouterState state) {
                return const TransactionsScreen();
              },
            ),
            GoRoute(
              path: 'recharge',
              builder: (BuildContext context, GoRouterState state) {
                return const CryptoRechargeScreen();
              },
            ),
          ],
        ),
      ],
    ),
  ],
);
